home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 1 / Amiga Tools.iso / egs-tools / egs_demo-version / egs_devels / doc / egsblit.doc < prev    next >
Text File  |  1994-06-06  |  15KB  |  587 lines

  1. /*
  2. *  $
  3. *  $ FILE     : egsblit.doc
  4. *  $ VERSION  : 1
  5. *  $ REVISION : 1
  6. *  $ DATE     : 08-Feb-93 10:03
  7. *  $
  8. *  $ Author   : mvk
  9. *  $
  10. *
  11. *
  12. * (c) Copyright 1990/93 VIONA Development
  13. *     All Rights Reserved
  14. *
  15. */
  16. egsblit.library/EB_BitAreaCircle
  17. egsblit.library/EB_BitAreaPolygon
  18. egsblit.library/EB_CopyBitMap
  19. egsblit.library/EB_CopyBitMapClipped
  20. egsblit.library/EB_Draw
  21. egsblit.library/EB_DrawClipped
  22. egsblit.library/EB_FillMask
  23. egsblit.library/EB_FillMaskClipped
  24. egsblit.library/EB_FloodFill
  25. egsblit.library/EB_InvertPixel
  26. egsblit.library/EB_InvertRectangle
  27. egsblit.library/EB_ReadPixel
  28. egsblit.library/EB_RectangleClipped
  29. egsblit.library/EB_RectangleFill
  30. egsblit.library/EB_UnpackImage
  31. egsblit.library/EB_Write
  32. egsblit.library/EB_WriteClipped
  33. egsblit.library/EB_WritePixel
  34.  
  35.  
  36. egsblit.library/EB_BitAreaCircle
  37.  
  38. NAME
  39.   EB_BitAreaCircle   Draw circle in one bit deep map
  40.  
  41. SYNOPSIS
  42.   EB_BitAreaCircle(dst, radius)
  43.            A0   D0
  44.  
  45.   E_EBitMapPtr  dst;
  46.   UWORD         radius;
  47.  
  48. FUNCTION
  49.   Draw a circle in a one bit deep map. The dimensions of the map are modified
  50.   to fit the circle. The result can be used for EB_FillMask or
  51.   EB_FillMaskClipped.
  52.  
  53. INPUTS
  54.   radius :   radius of desired circle
  55.  
  56. RETURNS
  57.  
  58.  
  59. egsblit.library/EB_BitAreaPolygon
  60.  
  61. NAME
  62.   EB_BitAreaPolygon  Draw polygon in one bit deep map
  63.  
  64. SYNOPSIS
  65.   EB_BitAreaPolygon(dst, poly, range, width, height)
  66.             A0   A1    D0     D1     D2
  67.  
  68.   E_EBitMapPtr  dst;
  69.   EB_PolygonPtr poly;
  70.   UWORD         range, width, height;
  71.  
  72. FUNCTION
  73.   Draws a one bit deep polygon in a map. Modifies the dimensions of the map
  74.   to fit the requierements of the polygon. The result can be used for
  75.   FillMask or FillMaskClipped. To draw several polygons at once, or holes in
  76.   polygons you can link them (p0-p1-p2-q0-q1-q2-q3-p2-p3)
  77.  
  78. INPUTS
  79.   poly          : Pointer to array of coordinate pairs. The coordinates should
  80.           be alligned to the upper left border.
  81.   range         : Number of vertices.
  82.   width, height : Dimensions of polygon
  83.  
  84. RETURNS
  85.  
  86.  
  87. egsblit.library/EB_CopyBitMap
  88.  
  89. NAME
  90.   EB_CopyBitMap  Copy rectangle from bitmap to bitmap
  91.  
  92. SYNOPSIS
  93.   EB_CopyBitMap(src, dst, xs, ys, width, height, xd, yd, mask)
  94.         A0   A1   D0  D1  D2     D3      D4  D5  D6
  95.  
  96.   E_EBitMapPtr   src, dst;
  97.   WORD           xs, ys, width, height, xd, yd;
  98.   ULONG          mask;
  99.  
  100. FUNCTION
  101.   Copies a rectangular area from one bitmap to an other (or the same). No
  102.   clipping is performed either on source neither on destination. If source
  103.   bitmap is a real color map (24 Bits) and the destination is not, a
  104.   conversion will be done. This function may also be used, to make conversions
  105.   between different bitmap types.
  106.  
  107.   The function will certainly be replaced by a blitter, i.e. it should be used
  108.   in any case. "width" and "height" have the same meaning as for
  109.   "EB_RectangleFill".
  110.  
  111. INPUTS
  112.   src           : Source bitmap
  113.   dst           : Destination bitmap
  114.   xs, ys        : Location of source rectangle
  115.   width, height : Dimensions of rectangle
  116.   xd, yd        : Location of destination rectangle
  117.   mask          : Bit mask for operation. Bits which are set in mask
  118.           are not modified. (Not implemented yet, should be
  119.           zero for future compatibility)
  120.  
  121. RETURNS
  122.  
  123.  
  124. egsblit.library/EB_CopyBitMapClipped
  125.  
  126. NAME
  127.   EB_CopyBitMapClipped  Copy rectangle from bitmap to bitmap clipped
  128.  
  129. SYNOPSIS
  130.   EB_CopyBitMapClipped(src, dst, rect, xs, ys, width, height, xd, yd, mask)
  131.                A0   A1   A2    D0  D1  D2     D3      D4  D5  D6
  132.  
  133.   E_EBitMapPtr    src, dst;
  134.   EB_ClipRectPtr  rect;
  135.   WORD            xs, ys, width, height, xd, yd;
  136.   ULONG           mask;
  137.  
  138. FUNCTION
  139.   Copies a rectangluar area from a bitmap to an other (or the same). Clipping
  140.   is performed through the cliprect. If source bitmap is a real color map
  141.   (24 Bits) and the destination is not, a conversion will be done.
  142.  
  143. INPUTS
  144.   src           : Source bitmap
  145.   dst           : Destination bitmap
  146.   xs, ys        : Location of source rectangle
  147.   width, height : dimensions of rectangle
  148.   xd, yd        : location of destination rectangle
  149.   mask          : Bit mask for operation. Bits which are set in mask
  150.           are not modified. (Not implemented yet, should be
  151.           zero for future compatibility)
  152.  
  153. RETURNS
  154.  
  155.  
  156. egsblit.library/EB_Draw
  157.  
  158. NAME
  159.   EB_Draw  Draw line
  160.  
  161. SYNOPSIS
  162.   EB_Draw(map, c, x1, y1, x2, y2, mask)
  163.       A0   D0 D1  D2  D3  D4  D5
  164.  
  165.   E_EBitMapPtr    map;
  166.   ULONG           c;
  167.   WORD            x1, y1, x2, y2;
  168.   ULONG           mask;
  169.  
  170. FUNCTION
  171.   Draws a line of color c into a bitmap. If the color is a 24Bit color
  172.   (using the heigher 24Bits, but not the lower eight) and the bitmap is no
  173.   real color map, the next matching color is chosen. No clipping is performed.
  174.  
  175.   The function uses a modified Bresenham algorithm for ultimate speed and will
  176.   certainly be replaced by a blitter.  This means it should be used in any
  177.   case.
  178.  
  179. INPUTS
  180.   map           : map in which to render
  181.   c             : color, -1 to invert
  182.   x1, y1        : starting position
  183.   x2, y2        : ending position
  184.   mask          : Bit mask for operation. Bits which are set in mask
  185.           are not modified. (Not implemented yet, should be
  186.           zero for future compatibility)
  187.  
  188. RETURNS
  189.  
  190.  
  191. egsblit.library/EB_DrawClipped
  192.  
  193. NAME
  194.   EB_DrawClipped  Draw line clipped
  195.  
  196. SYNOPSIS
  197.   EB_DrawClipped(map, rect, c, x1, y1, x2, y2, mask)
  198.          A0   A1    D0 D1  D2  D3  D4  D5
  199.  
  200.   E_EBitMapPtr    map;
  201.   EB_ClipRectPtr  rect;
  202.   ULONG           c;
  203.   WORD            x1, y1, x2, y2;
  204.   ULONG           mask;
  205.  
  206. FUNCTION
  207.   Draw a line into a bitmap (see also EB_Draw). Clipping is performed using
  208.   the cliprect. The function only clips in one cliprect. To render through
  209.   a list of cliprects, you should call this function once for every cliprect.
  210.   The function respects the remainder when clipping, so if using several
  211.   cliprects, the line is not broken at borders.
  212.  
  213. INPUTS
  214.   map           : bitmap in which to render
  215.   rect          : cliprect for clipping
  216.   c             : color, -1 to invert
  217.   x1, y1        : starting position
  218.   x2, y2        : ending position
  219.   mask          : Bit mask for operation. Bits which are set in mask
  220.           are not modified. (Not implemented yet, should be
  221.           zero for future compatibility)
  222.  
  223. RETURNS
  224.  
  225.  
  226. egsblit.library/EB_FillMask
  227.  
  228. NAME
  229.   EB_FillMask  Fill rectangle in bitmap through one pixel deep map
  230.  
  231. SYNOPSIS
  232.   EB_FillMask(mask, dst, pattern, x, y, mask2)
  233.           A0     A1  A2       D0 D1 D2
  234.  
  235.   E_EBitMapPtr    mask, dst;
  236.   EB_ImageDesPtr  pattern;
  237.   WORD            x, y;
  238.   ULONG           mask2;
  239.  
  240. FUNCTION
  241.   Fills a rectangluar area with one or two colors, depending on a mask.
  242.   The size and location in the mask of the rectangle is described in
  243.   pattern. If the colors described in pattern are 24bit colors and the map
  244.   is no 24bit map, this function renders with color patterns, to simulate
  245.   24 bits.
  246.   The function serves as basic function for Amiga fonts and Area commands.
  247.  
  248. INPUTS
  249.   mask          : mask bitplane
  250.   dst           : destinaton bitmap
  251.   pattern       : description of source rectangle and colors
  252.   x, y          : destination location
  253.   mask2         : Bit mask for operation. Bits which are set in mask
  254.           are not modified. (Not implemented yet, should be
  255.           zero for future compatibility)
  256.  
  257. RETURNS
  258.  
  259.  
  260. egsblit.library/EB_FillMaskClipped
  261.  
  262. NAME
  263.   EB_FillMaskClipped  Fill rectangle clipped through one bit deep mask
  264.  
  265. SYNOPSIS
  266.   EB_FillMaskClipped(mask, dst, pattern, clip, x, y, mask2)
  267.              A0    A1   A2       A3    D0 D1 D2
  268.  
  269.   E_EBitMapPtr    mask, dst;
  270.   EB_ImageDesPtr  pattern;
  271.   EB_ClipRectPtr  clip;
  272.   WORD            x, y;
  273.   ULONG           mask2;
  274.  
  275. FUNCTION
  276.   Same as fill mask, but clipping is performed according to the cliprect.
  277.  
  278. INPUTS
  279.   mask          : mask bitplane
  280.   dst           : destinaton bitmap
  281.   pattern       : description of source rectangle and colors
  282.   clip          : cliprect
  283.   x, y          : destination location
  284.   mask2         : Bit mask for operation. Bits which are set in mask
  285.           are not modified. (Not implemented yet, should be
  286.           zero for future compatibility)
  287.  
  288. RETURNS
  289.  
  290.  
  291. egsblit.library/EB_FloodFill
  292.  
  293. NAME
  294.   EB_FloodFill  Fill connected area in bitmap
  295.  
  296. SYNOPSIS
  297.   EB_FloodFill(dst, clip, color, x, y, mode)
  298.            A0   A1    D0     D1 D2 D3
  299.  
  300.   E_EBitMapPtr    dst;
  301.   EB_ClipRectPtr  clip;
  302.   ULONG           color;
  303.   WORD            x, y;
  304.   ULONG           mode;
  305.  
  306. FUNCTION
  307.   Fills a consecutive area of pixels, the cliprect serves as additional border,
  308.   if the area is open to the verge. If mode is set to zero then then that
  309.   segement is filled which has the color of the starting point, else that
  310.   segment is filled, which is surrounded by the fill color.
  311.  
  312. INPUTS
  313.   dst     : Destination bitmap
  314.   clip    : cliprect
  315.   color   : fillcolor
  316.   x, y    : starting location
  317.  
  318. RETURNS
  319.  
  320.  
  321. egsblit.library/EB_InvertPixel
  322.  
  323. NAME
  324.   EB_InvertPixel  Invert a pixel
  325.  
  326. SYNOPSIS
  327.   EB_InvertPixel(map, x, y)
  328.          A0   D0 D1
  329.  
  330.   E_EBitMapPtr    map;
  331.   WORD            x, y;
  332.  
  333. FUNCTION
  334.   Inverts a pixel. Double usage of this function using same parameters will
  335.   result in no effect.
  336.  
  337. INPUTS
  338.  
  339. RETURNS
  340.  
  341.  
  342. egsblit.library/EB_InvertRectangle
  343.  
  344. NAME
  345.   EB_InvertRectangle  Invert the border of a rectangle
  346.  
  347. SYNOPSIS
  348.   EB_InvertRectangle(map, left, top, right, bottom)
  349.              A0   D0    D1   D2     D3
  350.  
  351.   E_EBitMapPtr    map;
  352.   WORD            left, top, right, bottom;
  353.  
  354. FUNCTION
  355.   Inverts the border of a rectangle. Double usage of this function using same
  356.   parameters will result in no effect. Should be used for mouse dragging
  357.   operations. This function is used by EGSIntui to move and resize windows.
  358.   Clipping is performed at the bitmap borders.
  359.  
  360. INPUTS
  361.  
  362. RETURNS
  363.  
  364.  
  365. egsblit.library/EB_ReadPixel
  366.  
  367. NAME
  368.   EB_ReadPixel  get the color of a pixel
  369.  
  370. SYNOPSIS
  371.   color = EB_ReadPixel(map, x, y)
  372.   D0                   A0   D0 D1
  373.  
  374.   ULONG           color;
  375.   E_EBitMapPtr    map;
  376.   WORD            x, y;
  377.  
  378. FUNCTION
  379.   Returns the color of a pixel. In pseudo modes this is the register number
  380.   in real mode its the color itself (RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx).
  381.   To allways get the real color use this:
  382.  
  383.     E_MouseOff(scr);
  384.     if (scr->map->depth<16)
  385.       color = E_GetRGB8(scr,EB_ReadPixel(scr->map,x,y));
  386.     else
  387.       color = EB_ReadPixel(scr->map,x,y);
  388.     E_MouseOn(scr);
  389.  
  390.   Reads a pixel's colour.  This function is certainly not accelerated by a
  391.   blitter.  Should be used for reasons of compatibility when using several
  392.   bit depths or when support of any new graphics card without software
  393.   modification is wanted.
  394.  
  395.   Obviously for 8 or 24 bit mode more direct techniques are recommended.
  396.  
  397. INPUTS
  398.   map    : pointer to the bitmap
  399.   x, y   : pixel coordinates in the map
  400.  
  401. RETURNS
  402.   the color, either a register value or a real color value, depending on
  403.   the mode
  404.  
  405.  
  406. egsblit.library/EB_RectangleClipped
  407.  
  408. NAME
  409.   EB_RectangleClipped  Fill rectangle clipped
  410.  
  411. SYNOPSIS
  412.   EB_RectangleClipped(map, rect, c, left, top, width, height, mask)
  413.               A0   A1    D0 D1    D2   D3     D4      D5
  414.  
  415.   E_EBitMapPtr    map;
  416.   EB_ClipRectPtr  rect;
  417.   ULONG           c;
  418.   WORD            left, top, width, height;
  419.   ULONG           mask;
  420.  
  421. FUNCTION
  422.   Same as EB_RectangleFill, but clipping is done using the cliprect.
  423.  
  424. INPUTS
  425.   mask          : Bit mask for operation. Bits which are set in mask
  426.           are not modified. (Not implemented yet, should be
  427.           zero for future compatibility)
  428.  
  429. RETURNS
  430.  
  431.  
  432. egsblit.library/EB_RectangleFill
  433.  
  434. NAME
  435.   EB_RectangleFill  Fill rectangle
  436.  
  437. SYNOPSIS
  438.   EB_RectangleFill(map, c, left, top, width, height, mask)
  439.            A0   D0 D1    D2   D3     D4      D5
  440.  
  441.   E_EBitMapPtr    map;
  442.   ULONG           c;
  443.   WORD            left, top, width, heigth;
  444.   ULONG           mask;
  445.  
  446. FUNCTION
  447.   Fills a rectangular area in a bitmap. If the color is a 24 bit color, but the
  448.   bitmap is not 24 bit deep, the function fills with a color pattern to
  449.   simulate 24 bits.
  450.   "width" and "height" describe the real width and height in pixels, i.e.
  451.   a one-pixeled rectangle has width=height=1.
  452.  
  453.   This function will certainly be replaced by a blitter and therefore should
  454.   be used in any case.
  455.  
  456. INPUTS
  457.   map           : bitmap in which to fill
  458.   c             : color, -1 to invert
  459.   left, top     : uppper left corner of rectangle
  460.   width, height : dimensions of rectangle
  461.   mask          : Bit mask for operation. Bits which are set in mask
  462.           are not modified. (Not implemented yet, should be
  463.           zero for future compatibility)
  464.  
  465. RETURNS
  466.  
  467.  
  468. egsblit.library/EB_UnpackImage
  469.  
  470. NAME
  471.   EB_UnpackImage  convert image to bitmap
  472.  
  473. SYNOPSIS
  474.   map = EB_UnpackImage(image, depth, colors)
  475.   D0                   A1     D0     A2
  476.  
  477.   E_EBitMapPtr     map;
  478.   EB_ImagePtr      image;
  479.   UWORD            depth;
  480.   EB_ColorTablePtr colors;
  481.  
  482. FUNCTION
  483.   As the egs libraries work in different bit depths, and bitmap organisations,
  484.   there has to be an standardized format for icon, images etc. This format
  485.   is defined in EB_Image. The aim of this function is to convert from this
  486.   format to a bitmap. This function also allocates a bitmap in fast mem.
  487.  
  488. INPUTS
  489.   image    : Image to convert
  490.   depth    : depth for destination
  491.   colors   : array of colors to use for conversion
  492.  
  493. RETURNS
  494.  
  495.  
  496. egsblit.library/EB_Write
  497.  
  498. NAME
  499.   EB_Write  write text in build in font
  500.  
  501. SYNOPSIS
  502.   EB_Write(map, color, x, y, str, len, mask)
  503.        A0   A2     D0 D1 A3   D2   D3
  504.  
  505.   E_EBitMapPtr    map;
  506.   EB_ColorDesPtr  color;
  507.   WORD            x, y;
  508.   CHAR *          str;
  509.   UWORD           len;
  510.   ULONG           mask;
  511.  
  512. FUNCTION
  513.   Renders a text into a bitmap, using a build in 8x10 non proportional font.
  514.   This function is faster than the EB_UnpackImage which is used by EG_Text, to
  515.   render amiga fonts.
  516.   If your programs use lots of text and have no extraordinary font require-
  517.   ments you should use this font.
  518.  
  519. INPUTS
  520.   map           : destination bitmap
  521.   color         : description of front and back color and transparency
  522.   x, y          : starting location
  523.   str           : text
  524.   len           : length of text
  525.   mask          : Bit mask for operation. Bits which are set in mask
  526.           are not modified. (Not implemented yet, should be
  527.           zero for future compatibility)
  528.  
  529. RETURNS
  530.  
  531.  
  532. egsblit.library/EB_WriteClipped
  533.  
  534. NAME
  535.   EB_WriteClipped  write text clipped in build in font
  536.  
  537. SYNOPSIS
  538.   EB_WriteClipped(map, rect, color, x, y, str, len, mask)
  539.           A0   A1    A2     D0 D1 A3   D2   D3
  540.  
  541.   E_EBitMapPtr     map;
  542.   EB_ClipRectPtr   rect;
  543.   EB_ColorDesPtr   color;
  544.   WORD             x, y;
  545.   CHAR *           str;
  546.   UWORD            len;
  547.   ULONG            mask;
  548.  
  549. FUNCTION
  550.   Same as EB_Write, but clipping is performed using the cliprect.
  551.  
  552. INPUTS
  553.   mask          : Bit mask for operation. Bits which are set in mask
  554.           are not modified. (Not implemented yet, should be
  555.           zero for future compatibility)
  556.  
  557. RETURNS
  558.  
  559.  
  560. egsblit.library/EB_WritePixel
  561.  
  562. NAME
  563.   EB_WritePixel  set a pixel
  564.  
  565. SYNOPSIS
  566.   EB_WritePixel(map, c, x, y, mask)
  567.         A0   D0 D1 D2 D3
  568.  
  569.   E_EBitMapPtr     map;
  570.   ULONG            c;
  571.   WORD             x, y;
  572.   ULONG            mask;
  573.  
  574. FUNCTION
  575.   Writes pixel into a bitmap. If the color is 24 bit color but the bitmap is
  576.   not the library simulates a 24 bit bitmap, using patterns. See also
  577.   EB_ReadPixel.
  578.  
  579. INPUTS
  580.   mask          : Bit mask for operation. Bits which are set in mask
  581.           are not modified. (Not implemented yet, should be
  582.           zero for future compatibility)
  583.  
  584. RETURNS
  585.  
  586.  
  587.